xen/arm: Support properly __ro_after_init on Arm
authorJulien Grall <jgrall@amazon.com>
Tue, 16 Aug 2022 18:59:54 +0000 (19:59 +0100)
committerJulien Grall <julien@xen.org>
Wed, 31 Aug 2022 18:53:06 +0000 (19:53 +0100)
commitace403022358b736755e3042e949540e775c65f1
tree8928e556951813cca3a4885eea634d08f01266ba
parentcbb35e72802f3a285c382a995ef647b59e5caf2f
xen/arm: Support properly __ro_after_init on Arm

__ro_after_init was introduced recently to prevent modifying
some variables after init.

At the moment, on Arm, the variables will still be accessible
because the region permission is not updated.

Address that by moving the sections .data.ro_after_init
out of .data and then map the region read-only once we finish
to boot.

Signed-off-by: Julien Grall <jgrall@amazon.com>
Reviewed-by: Penny Zheng <penny.zheng@arm.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Tested-by: Henry Wang <Henry.Wang@arm.com>
xen/arch/arm/include/asm/setup.h
xen/arch/arm/setup.c
xen/arch/arm/xen.lds.S